package com.hong.spring.junit;

import com.hong.spring.junit.bean.Student;
import org.springframework.beans.factory.annotation.Autowired;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

/**
 * @Auther: csh
 * @Date: 2020/10/12 17:17
 * @Description:用户服务
 */
public class UserService{
    @Autowired
    private String userName;

    @Autowired
    private Student student;

    @PostConstruct
    private void start(){
        System.out.println("start:"+userName);
        System.out.println("start:"+student);
    }

    @PreDestroy
    private void stop(){
        System.out.println("stop:"+userName);
        System.out.println("stop:"+student);
    }
}
